<?php

require_once dirname(__FILE__).'/../lib/categoriesGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/categoriesGeneratorHelper.class.php';

/**
 * categories actions.
 *
 * @package    IPLIFE
 * @subpackage categories
 * @author     alexey.shapran@gmail.com
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class categoriesActions extends autoCategoriesActions
{
	protected function getSort()
	{
		if (null !== $sort = $this->getUser()->getAttribute('categories.sort', null, 'admin_module'))
		{
			if($sort[0]!='updated_at')
				return $sort;
			else
				return array('parentid','asc');
		}
	
		$this->setSort($this->configuration->getDefaultSort());
		$sort = $this->getUser()->getAttribute('categories.sort', null, 'admin_module');

		if($sort[0]!='updated_at')
				return $sort;
		else
				return array('parentid','asc');
	}

}
